package bist.believeinstep.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import bist.believeinstep.domain.Contact;

public class ContactMapper implements RowMapper<Contact>{
	public Contact mapRow(ResultSet rs, int rowNum) throws SQLException{
		
		Contact contact = new Contact();
		contact.setId(rs.getInt("id"));
		contact.setName(rs.getString("name"));
		contact.setAddress(rs.getString("address"));
		contact.setPhone(rs.getString("phone"));
		contact.setEmail(rs.getString("email"));
		contact.setCellphone(rs.getString("cellphone"));
		contact.setTaxCode(rs.getString("tax_code"));
		contact.setCreated(rs.getTimestamp("created_date"));
		contact.setModified(rs.getTimestamp("modified_date"));
		contact.setCreatedBy(rs.getString("created_by"));
		contact.setModifiedBy(rs.getString("modified_by"));
		
		return contact;
	}
}
